home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_qt.idb / usr / freeware / include / Qt / qcollection.h.z / qcollection.h
Encoding:
C/C++ Source or Header  |  1998-10-28  |  1.7 KB  |  61 lines

  1. /****************************************************************************
  2. ** $Id: qcollection.h,v 2.4 1998/07/03 00:09:43 hanord Exp $
  3. **
  4. ** Definition of base class for all collection classes
  5. **
  6. ** Created : 920629
  7. **
  8. ** Copyright (C) 1992-1998 Troll Tech AS.  All rights reserved.
  9. **
  10. ** This file is part of Qt Free Edition, version 1.40.
  11. **
  12. ** See the file LICENSE included in the distribution for the usage
  13. ** and distribution terms, or http://www.troll.no/free-license.html.
  14. **
  15. ** IMPORTANT NOTE: You may NOT copy this file or any part of it into
  16. ** your own programs or libraries.
  17. **
  18. ** Please see http://www.troll.no/pricing.html for information about 
  19. ** Qt Professional Edition, which is this same library but with a
  20. ** license which allows creation of commercial/proprietary software.
  21. **
  22. *****************************************************************************/
  23.  
  24. #ifndef QCOLLECTION_H
  25. #define QCOLLECTION_H
  26.  
  27. #ifndef QT_H
  28. #include "qglobal.h"
  29. #endif // QT_H
  30.  
  31.  
  32. typedef void *GCI;                // generic collection item
  33. typedef int (*GCF)(GCI,void*);            // generic collection function
  34.  
  35. class QGVector;
  36. class QGList;
  37. class QGDict;
  38.  
  39.  
  40. class QCollection                // inherited by all collections
  41. {
  42. public:
  43.     bool autoDelete()    const           { return del_item; }
  44.     void setAutoDelete( bool enable )  { del_item = enable; }
  45.  
  46.     virtual uint  count() const = 0;
  47.     virtual void  clear() = 0;            // delete all objects
  48.  
  49. protected:
  50.     QCollection() { del_item = FALSE; }        // no deletion of objects
  51.     virtual ~QCollection() {}
  52.  
  53.     bool del_item;                // default FALSE
  54.  
  55.     virtual GCI         newItem( GCI );        // create object
  56.     virtual void     deleteItem( GCI );        // delete object
  57. };
  58.  
  59.  
  60. #endif // QCOLLECTION_H
  61.